<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>New project</title>

		<!-- Allow fullscreen mode on iOS devices. (These are Apple specific meta tags.) -->
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="HandheldFriendly" content="true" />

		<link rel="stylesheet" href="../../vendor/bootstrap/css/bootstrap.css" />
		<link rel="stylesheet" href="../../vendor/fancybox/jquery.fancybox-1.3.4.css" />
		<link rel="stylesheet" href="../../css/style.css" />

		<script type="text/javascript" src="../../vendor/bootstrap/js/jquery.js"></script>
		<script type="text/javascript" src="../../vendor/fancybox/jquery.fancybox-1.3.4.js"></script>

		<script>
			var sec = 0;
			function pad(val) {
				return val > 9 ? val : "0" + val;
			}

			$(function(){
				setInterval(function() {
					document.getElementById("seconds").innerHTML = pad(++sec % 60);
					document.getElementById("minutes").innerHTML = pad(parseInt(sec / 60, 10));
				}, 1000);
			});

		</script>
	</head>
	<body id="body" onload="init();">
		<div id="mainContent" class="centredContent">
			<table width="100%" height="100%">
				<tr>
					<td valign="top" style="width:40%;" >
					<div class="accordion" id="accordion2">
						<div class="accordion-group">
							<div class="accordion-heading">
								<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo" onclick=""> >>> Joystick  Mode</a>
							</div>
							<div style="overflow: hidden; max-height: 500px;" id="collapseTwo" class="accordion-body collapse">
								<div  class="accordion-inner">
									<img src="../../media/instrucoes.png" height="580px"/>
								</div>
							</div>
						</div>
						<div class="accordion-group">
							<div class="accordion-heading">
								<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne" onclick=""> >>> Programming Mode </a>
							</div>
							<div id="collapseOne" class="accordion-body collapse in">
								<div class="accordion-inner">
									<table width="100%" style="margin-top: -1px;">
										<tr height="auto">
											<td><div id="blocklyDiv" style="height: 410px;  border: 1px solid #ccc;"></div></td>
										</tr>
										<tr height="70">
											<td>
											<table>
												<tr>
													<td style="width: 230; text-align: center;">
													<div id="toolbarDiv" >
														<button title="See generated JavaScript code" onclick="codeButtonClick();">
															<img src='../../media/code.png' height=21 width=21>
														</button>

														<!--
														<button id="linkButton" title="Save and link to blocks" onclick="">
														<img src='media/link.png' height=21 width=21>
														</button>-->

													</div></td>
													<td style="width: 15px;"><img id="spinner" style="visibility: hidden;" src="media/loading.gif" height=15 width=15></td>
													<td style="width: 250px; text-align: center">
													<button id="runButton" class="launch btn btn-success btn-large pull-right" onclick="runButtonClick();">
														Play
													</button>
													<button id="resetButton" class="launch  btn btn-danger btn-large pull-right" onclick="resetButtonClick();" style="display: none">
														Restart
													</button></td>
												</tr>

											</table></td>
										</tr>
										<tr>
											<td>
											<div id="toolbarDiv" style="display:none;">
												<button title="See generated JavaScript code" onclick="">
													<img src='../../media/code.png' height=21 width=21>
												</button>
												<button id="linkButton" title="Save and link to blocks" onclick="">
													<img src='../../media/link.png' height=21 width=21>
												</button>
											</div></td>
										</tr>
									</table>
								</div>
							</div>
						</div>

					</div></td>
					<td valign="top" style="width:60%; overflow: hidden;">
					<div>

						<div id="c2canvasdiv" style="width:95% !important; height:600px !important; margin-left: 10px !important;">
							<div id="player-perfrmance">
								<div id="clock-wrapper">

									<p>
										<span id="minutes">01</span>:<span id="seconds">59</span>
									</p>
								</div>
								<div id="player-info">
									John Doe
									<div id="player-avatar"><img src="media/player.png">
									</div>
								</div>
							</div>
							<!-- The canvas the project will render to.  If you change its ID, don't forget to change the
							ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->
							<canvas id="c2canvas" width="640" height="450">
								<!-- This text is displayed if the visitor's browser does not support HTML5.
								You can change it, but it is a good idea to link to a description of a browser
								and provide some links to download some popular HTML5-compatible browsers. -->
								<h1>Your browser does not appear to support HTML5.  Try upgrading your browser to the latest version. <a href="http://www.whatbrowser.org">What is a browser?</a>
								<br/>
								<br/>
								<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a>
								<br/>
								<a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a>
								<br/>
								<a href="http://www.google.com/chrome/">Google Chrome</a>
								<br/>
								<a href="http://www.apple.com/safari/download/">Apple Safari</a>
								<br/>
								<a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a>
								<br/>
								</h1>
							</canvas>
						</div>
					</div></td>

				</tr>
			</table>
		</div>
		<script type="text/javascript" src="../../vendor/blockly/blockly_compressed.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/generators/javascript.js"></script>

		<script type="text/javascript" src="../../vendor/blockly/generators/javascript/control.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/generators/javascript/logic.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/generators/javascript/math.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/generators/javascript/text.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/en/_messages.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/language/common/control.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/language/common/logic.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/language/common/math.js"></script>
		<script type="text/javascript" src="../../vendor/blockly/language/common/text.js"></script>

		

		<script>
			function init() {
				Blockly.inject(document.getElementById('blocklyDiv'), {
					path : './',
					toolbox : document.getElementById('toolbox')
				});
			}

			function runButtonClick() {
				document.getElementById('runButton').style.display = 'none';
				document.getElementById('resetButton').style.display = 'inline';
				gamedugame.blockly.execute();
			}

			function resetButtonClick() {
				document.getElementById('runButton').style.display = 'inline';
				document.getElementById('resetButton').style.display = 'none';
				gamedugame.blockly.reset();
			}

			function codeButtonClick() {
				gamedugame.blockly.showCode();
			}
		</script>

		<link href="../../vendor/blockly/css/blockly.css" rel="stylesheet" type="text/css">

		

		<script type="text/javascript" src="../../vendor/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="../../js/gameduapi.js"></script>

		<!-- Construct 2 exported games require jQuery. -->
		<script src="../../vendor/jquery-2.0.0.min.js"></script>

		<!-- The runtime script.  You can rename it, but don't forget to rename the reference here as well.
		This file will have been minified and obfuscated if you enabled "Minify script" during export. -->
		
		<!--	Porteiner v.3  
			<script src="c2runtime.js"></script>
		    <script type="text/javascript" src="../../js/customblocks_porteiner.js"></script>
		
			<xml id="toolbox" style="display: none">
				<block type="controls_repeat"></block>
				<block type="gamedu_move"></block>
				<block type="gamedu_drophold"></block>
				<block type="gamedu_shoot"></block>
				<block type="gamedu_cuboVermelho"></block>
				<block type="gamedu_cuboAzul"></block>
			</xml>
		
		-->
		<!-- Bola demolidora  -->
		<script src="c2runtime.js"></script>
		<script type="text/javascript" src="../../js/customblocks_bolademolidora.js"></script>
		
		<xml id="toolbox" style="display: none">
				<block type="controls_repeat"></block>
				<block type="gamedu_move"></block>
				<block type="gamedu_shoot"></block>
		</xml>
				
		<script>
			// Size the canvas to fill the browser viewport.
			jQuery(window).resize(function() {
				cr_sizeCanvas(jQuery("#c2canvasdiv").width(), jQuery("#c2canvasdiv").height());
			});

			// Start the Construct 2 project running on window load.
			jQuery(document).ready(function() {
				// Create new runtime using the c2canvas
				cr_createRuntime("c2canvas");
			});

			// Pause and resume on page becoming visible/invisible
			function onVisibilityChanged() {
				if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
					cr_setSuspended(true);
				else
					cr_setSuspended(false);
			};

			document.addEventListener("visibilitychange", onVisibilityChanged, false);
			document.addEventListener("mozvisibilitychange", onVisibilityChanged, false);
			document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false);
			document.addEventListener("msvisibilitychange", onVisibilityChanged, false);
		</script>

	</body>
</html>